package com.xmy.cultivate.listeners;

import com.xmy.cultivate.constants.MqConstants;
import com.xmy.cultivate.entity.MqSchedulingLog;
import com.xmy.cultivate.entity.MultiDelayMessage;
import com.xmy.cultivate.entity.Student;
import com.xmy.cultivate.service.IMqPushService;
import com.xmy.cultivate.service.IWecharPushService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.AmqpException;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessagePostProcessor;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import static com.xmy.cultivate.constants.MqConstants.*;

@Slf4j
@Component
public class WechartListener {

    @Autowired
    IMqPushService iMqPushService;

    @Autowired
    IWecharPushService iWecharPushService;


    /**
     * 上课提醒
     * @param multiDelayMessage
     */
//    @RabbitListener(bindings = @QueueBinding(
//            value = @Queue(name = QUEUE_DELAY_CLASS_REMIND_Q1, durable = "true"),
//            exchange = @Exchange(name = EXCHANGE_DELAY_CLASS_REMIND_DIRECT, delayed = "true")
//    ))
//    public void delayClassRemind(MultiDelayMessage<MqSchedulingLog> multiDelayMessage){
//        //log.info("接收到delay.queue的延迟消息2：{}", multiDelayMessage);
//        iWecharPushService.delayClassRemind(multiDelayMessage);
//    }

}
